#define  _CRT_SECURE_NO_WARNINGS 1

#include<string>
#include"vector.h"

using namespace std;

void TestVector1()
{
	zhh::vector<int> v;
	v.push_back(6);
	v.push_back(1);
	v.push_back(5);
	v.push_back(3);
	v.push_back(2);
	for (auto e : v)
	{
		std::cout << e << " ";
	}
	std::cout << std::endl;
	v.insert(v.begin() + 2, 0);
	for (auto e : v)
	{
		std::cout << e << " ";
	}
	std::cout << std::endl;
	v.erase(v.begin() + 1);
	v.erase(v.begin() + 1);
	v.erase(v.begin() + 1 );
	for (auto e : v)
	{
		std::cout << e << " ";
	}
	std::cout << std::endl;

	v.pop_back();
	for (auto e : v)
	{
		std::cout << e << " ";
	}
	std::cout << std::endl;
}

void TestVector2()
{
	zhh::vector<int> v1(10, 6);
	for (auto e : v1)
	{
		std::cout << e << " ";
	}
	std::cout << std::endl;
	
	zhh::vector<string> v3(10, "1111111");
	for (auto e : v3)
	{
		std::cout << e << " ";
	}
	std::cout << std::endl;

	string str("qwertyuiop");
	zhh::vector<char> v2(str.begin(), str.end());
	for (auto e : v2)
	{
		std::cout << e << " ";
	}
	std::cout << std::endl;


}

void TestVector3()
{
	zhh::vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);

	auto rit = v.rbegin();
	while (rit != v.rend())
	{
		cout << *rit << " ";
		++rit;
	}
	cout << endl;
}

int main()
{
	//TestVector1();
	//TestVector2();
	TestVector3();
	return 0;
}